package com.estar.integaration.Util.ExcelReader;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.alibaba.fastjson.JSON;

import java.util.ArrayList;
import java.util.List;

/**
 * Author: YJL
 * Date: 2022/2/14 15:05
 **/
public class DataListener extends AnalysisEventListener<MaterialListItem> {

  List<MaterialListItem> list = new ArrayList<>();

  public DataListener(List<MaterialListItem> list) {
    this.list = list;
  }

  @Override
  public void invoke(MaterialListItem materialListItem, AnalysisContext analysisContext) {
    list.add(materialListItem);
    System.out.println("解析了一条数据");
  }

  @Override
  public void doAfterAllAnalysed(AnalysisContext analysisContext) {

  }
}
